{% extends "baseMenu.html" %}

{% block content %}
<table style="text-align: left; height: 100%;border: 3px solid rgb(0,0,0); padding:10px; box-shadow: 0px 0px 10px 10px rgba(70,70,70, 0.4) inset;background-color:rgb(255,255,255);">
	{% if mensaje %}<tr><td>{{ mensaje }}</td></tr>{% endif %}
	{% if error %} <tr><td style="text-align: center;"><font color="red" size=2>Error: {{ error }}</font></td></tr>{% endif %}
	<tr><td style="font-style: italic; font-weight: bold; color: black;font-family: Lohit Punjabi;height: 10%;">
	<form name="formUnidad" action="" method="post">{% csrf_token %}
		<table>
			<tr><td>{{ form.idbus }}</td></tr>
		    <tr>
		        <td> <label for="id_linea"> Linea: </label> {{ form.linea }} 
		        <SELECT NAME="lineaCombo" SIZE=1 onchange="document.formUnidad.id_linea.value = document.formUnidad.lineaCombo.options[document.formUnidad.lineaCombo.selectedIndex].value;document.formUnidad.lineaCombo.value=document.formUnidad.lineaCombo.options[document.formUnidad.lineaCombo.selectedIndex].value">
		        <OPTION VALUE="">Seleccione un valor</OPTION> 
		        {% for route in routeList %}
		            <OPTION {% if temporaryBus and temporaryBus.linea == route %} SELECTED {% endif %}VALUE="{{ route.linea }}">{{ route.linea }}</OPTION>
		        {% endfor %}
		        </SELECT></td>
		    </tr>
		    <tr><td> <label for="id_unidad_linea"> Identificador: </label> {{ form.id_unidad_linea }} </td></tr>
		    <tr><td> <label for="id_apto"> Apto para movilidad reducida: </label> {{ form.apto_movilidad_reducida }} </td></tr>
		    <tr><td>{{ form.action }}</td></tr>
		</table>
		<input type="button" name="back" id="back" value="Descartar" onClick="javaScript:history.back();">
		<BUTTON type="submit" name="save" value="save"> Guardar</BUTTON>
  	</form>
	</td></tr>
</table>
{% endblock %}

{% block extrahead %}
	<script type='text/javascript'>
		function initialize(){
			document.getElementById("id_action").value = document.location.search.substr(1);
		}
	</script>
{% endblock %}